type MinStack struct {
	arr []int
}

/** initialize your data structure here. */
func Constructor() MinStack {
	var mS MinStack
	mS.arr = make([]int, 0)
	return mS
}

func (this *MinStack) Push(x int) {
	this.arr = append(this.arr, x)
}

func (this *MinStack) Pop() {
	if len(this.arr) == 1 {
		this.arr = make([]int, 0)
	} else {
		this.arr = this.arr[:len(this.arr)-1]
	}
}

func (this *MinStack) Top() int {
	return this.arr[len(this.arr)-1]
}

func (this *MinStack) GetMin() int {
	min := this.arr[0]
	if len(this.arr) == 1 {
		return min
	} else {
		for i := 0; i < len(this.arr); i++ {
			if this.arr[i] < min {
				min = this.arr[i]
			}
		}
	}
	return min
}

/**
 * Your MinStack object will be instantiated and called as such:
 * obj := Constructor();
 * obj.Push(x);
 * obj.Pop();
 * param_3 := obj.Top();
 * param_4 := obj.GetMin();
 */